﻿@model  LogOnModel
@{
    Layout = "~/Views/Shared/_BaseLayout.cshtml";
    ViewBag.Title = "登陆";
}
@Html.ValidationSummary(true, "登陆失败，请重试！")
@using (Html.BeginForm())
{
    <div style="margin-left: 30%; margin-top:100px; width: 500px;">
        <fieldset>
            <legend>账户登陆</legend>
            <p>
                请输入你的用户名和密码。
            </p>
            <table style="width:400px">
                <tbody>
                    <tr>
                        <td style="width:100px;">@Html.DisplayNameFor(m => m.UserName)：
                        </td>
                        <td>@Html.TextBoxFor(m => m.UserName)
                            @Html.ValidationMessageFor(m => m.UserName)
                        </td>
                    </tr>
                    <tr>
                        <td style="width:100px;">
                            @Html.DisplayNameFor(m => m.Password)：
                        </td>
                        <td>
                            @Html.PasswordFor(m => m.Password)
                            @Html.ValidationMessageFor(m => m.Password)
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td >
                            <label style="display: inline;width:100px">
                                @Html.DisplayNameFor(m => m.RememberMe, false)
                                @Html.CheckBoxFor(m => m.RememberMe)
                            </label>
                        </td>
                    </tr>
                    <tr><td></td><td > <input type="submit" value="登陆" class="btn btn-primary" /></td> </tr>
                </tbody>
            </table>
        </fieldset>
    </div>
}
<script type="text/javascript">
    $(function () {
        if ($('#MainContent').length > 0) {
            var url = '@Url.Action("LogOn", "Account")';
            window.location.href = url;
        }
    });
</script>
